import java.util.*;
import java.util.Map.Entry;

public class _03_LargestSequenceOfEqualStrings {
	
	public static void main(String[] args) {
		
		Scanner inputCS = new Scanner(System.in);
		String input = inputCS.nextLine();
		inputCS.close();
		
		String[] words = input.split(" ");
		
		NavigableMap<String, Integer> wordsFrequencies = new TreeMap<String, Integer>();
		
		for (String word : words) {
			
			Integer freq = wordsFrequencies.get(word);
			wordsFrequencies.put(word, (freq == null) ? 1 : freq + 1);
		}
		
		//String leastFrequent = (String) wordsFrequencies.keySet().toArray()[0];
		
		Entry<String, Integer> mostFrequent = wordsFrequencies.lastEntry();
		
		String key = mostFrequent.getKey();
		int value = mostFrequent.getValue();
		
		for (int i = 0; i < value; i++) {
			
			System.out.print(key + " ");
		}
	}
}